package com.app.utils;

import com.app.common.SystemConstant;

public class FileTypeUtil {
    //根据文件扩展名和 扩展名数组进行比较 获取扩展名类型
    public static Integer getFileType(String urlSuffix) {
        Integer type = 0;
        String[] imageSuffixArr = SystemConstant.IMAGE_SUFFIX.split(",");
        for (String image : imageSuffixArr) {
            if (urlSuffix.equals(image)) {
                type = 1;
            }
        }
        String[] videoSuffixArr = SystemConstant.VIDEO_SUFFIX.split(",");
        for (String video : videoSuffixArr) {
            if (urlSuffix.equals(video)) {
                type = 2;
            }
        }
        return type;
    }
}
